<template>
    <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="() => { $router.push('/home/cla') }" fixed />
    <div style="height: 45px;"></div>
    <div v-for="item in goodsData">
        <router-link :to="'/detail/'+item.goods_id">
            <van-card  :price="item.goods_price"  :title="item.goods_name"  
            :thumb="item.goods_big_logo ? item.goods_big_logo :'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg' " />
        </router-link>
    </div>

</template>

<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
let goodsData = ref([])
import { goodsApi } from '@/api/api'
goodsApi(route.params.cat_name).then(res => {
    console.log('商品列表', res)
    goodsData.value = res.data.message.goods
})
</script>

<style lang="scss" scoped></style>